package com.pn.warehouse.mapper;

import com.pn.warehouse.entity.User;
import com.pn.warehouse.page.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

//user_info表的mapper接口
public interface UserMapper {

    //根据账号查询用户的信息
    public User fingUserByCode(String userCode);

    //查询用户总行数
    public Integer findRowCount(User user);

    //分页查询用户信息
    public List<User> findUserByPage(@Param("page") Page page, @Param("user") User user);

    //添加用户
    public int addUser(User user);

    //启用或者禁用用户的状态
    public int setUserState(User user);

    //根据用户的ids逻辑删除用户
    public int deleteUserById(List<Integer> userIdList);

    //根据用户id修改用户昵称
    public int updateUserNameById(User user);

    //根据用户id修改密码
    public int updatePwdById(Integer userId, String password);

}
